<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/bootstrap/dist/css/bootstrap.min.css">
    <style>
        body{
            width: 100%;
            height: 1000px;
        }
        .jumbotron{
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-70%);
            width: 800px;
        }
    </style>
</head>
<body>
  <div class="container">
      <div class="jumbotron">
          <form id="FixForm">
              <div class="form-group">
                  <label for="id">Id</label>
                  <input type="number" class="form-control" name="id" id="id" value="{{result.id}}" disabled>
              </div>
              <input type="hidden" class="form-control" name="id" id="id" value="{{result.id}}">
              <div class="form-group">
                  <label for="username">username</label>
                  <input type="search" class="form-control" id="username" name="username" value="{{result.username}}" required>
              </div>
              <div class="form-group">
                  <label for="tel">telephone</label>
                  <input type="search" name="tel" id="tel" class="form-control" value="{{result.tel}}" required>
              </div>
              <div class="checkbox">
                  <label>
                      <input type="checkbox"> Check me out
                  </label>
              </div>
              <button type="reset" class="btn btn-outline-info">重置</button>
              <div class="modal-footer">
                  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                  <button type="submit" class="btn btn-primary" >提交</button>
              </div>
          </form>

      </div>
  </div>
  <script src="/jquery/dist/jquery.js"></script>
  <script src="/canvas-nest.js/dist/canvas-nest.js"></script>
  <script src="/bootstrap/dist/js/bootstrap.min.js"></script>
  <script>
      $(function () {
          $('#FixForm').on('submit',function (e) {
              e.preventDefault()
              let formDate=$(this).serialize()
              console.log(formDate)
              $.ajax({
                  url:'/fix',
                  type:'post',
                  data:formDate,
                  dataType:'json',
              }).then(function (data) {
                  let err_code= data.err_code
                  if(err_code===0){
                      window.location.href='/'
                  }else if(err_code===1){
                      window.alert('邮箱或密码错误！')
                  }else if (err_code===500){
                      window.alert('服务器繁忙，请稍后再试！')
                  }
              })
          })
      })
  </script>
</body>
</html>
